<?php
function combobox($name,$selected,$arr)
{
	$kq ="<select name='".$name."'>";
	foreach($arr as $key=>$value)
	{
		if($key == $selected)
			 $kq .= "<option value='".$key."' selected>".$value."</option>";
		else
			 $kq .= "<option value='".$key."'>".$value."</option>";
	}
	$kq .= "</select>";
	return $kq;
}

function format_day_to_YYYYMMDD($ngay)
{
	$kq="";
	$arrNgayFormat = explode(" ",$ngay);
	$arrNgay = explode("-",$arrNgayFormat[0]);
	//$arrGio = explode(":",$arrNgayFormat[1]);
	if($arrNgay[0] >= 1000)
	{
		$kq  = date("Y-m-d ", mktime(0,0,0,$arrNgay[1],$arrNgay[2],$arrNgay[0]));
	}
	else
	{
		$kq  = date("Y-m-d", mktime(0,0,0,$arrNgay[0],$arrNgay[1],$arrNgay[2]));
	}
	return $kq;
}
?>

	
    
